/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package grex.fitnessfunctions.ErrorFunctions;

import grex.Environment;
import grex.Data.Prediction;
import grex.Data.PredictionContainer;
import grex.Nodes.EnsPred;
import grex.fitnessfunctions.FitnessFunction;
import grex.fitnessfunctions.IFitnessFunction;
import grex.Nodes.Node;
import grex.Nodes.If;

/**
 *
 * @author RIK
 */
public class MeasureEnsPreds extends FitnessFunction{
    
    public MeasureEnsPreds(){
        super("ENSP");
    }       
    @Override
    protected double calcPredictionError(Prediction prediction, double targetValue) {
        if(prediction.getLeaf() instanceof EnsPred)
            return 1;
        else
            return 0;
    }
    
    @Override        
    protected double normalizeTotalError(double totalError){
        return totalError/100;
    }

}
